/* 
 * This file part of cget - A libcurl based downloading tool.
 * http://lianwei3.googlepages.com/home2
 * Copyright (C) 2006 Wei Lian <lianwei3@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Library General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef DOWNLOADER_H
#define DOWNLOADER_H

#include "header.h"
class Downloader {
  public:
    Downloader();
    ~Downloader();
    void execute_download(std::vector
			  < struct ThreadInfo >*vec_info,
			  uint num_thread, char *outfile_cg);

  private:
    static size_t my_write_func(char *ptr, size_t size, size_t nmemb,
				struct ThreadInfo *info);
    static int my_progress_func(struct ThreadInfo *info,
				double t, double d, double ut, double un);
    static void *thread_download(void *stream);

};

#endif
